package com.sren.boot.bootstrap;

import com.sren.boot.service.CalculateService;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author: renshuai
 * @date: 2019/11/25 上午9:22
 * @Description:
 */

@SpringBootApplication(scanBasePackages = "com.sren.boot.service")
public class CalculateServiceBootStrap {

	public static void main(String[] args) {
		ConfigurableApplicationContext context = new SpringApplicationBuilder(CalculateServiceBootStrap.class)
				.web(WebApplicationType.NONE)
				.profiles("java8")
				.run(args);

		CalculateService calculateService = context.getBean(CalculateService.class);
		System.out.println("sum = " + calculateService.sum(1, 2, 3));
		context.close();
	}
}
